<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrderTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('stock_order',function(Blueprint $table){
            $table->increments('id');
            $table->string('orderno');//订单编号
            $table->integer('activity_id');//活动id
            $table->integer('user_id');//活动发起人id
            $table->decimal('money',10,2);//金额
            $table->integer('op_id');//股票id
            $table->integer('status');//订单状态
            $table->decimal('buy_price',10,2);//买入价格
            $table->decimal('end_price',10,2);//结束价格
            $table->float('yield');//收益率
            $table->string('merchant');//商户编号
            $table->string('transaction_id');//微信订单编号
            $table->decimal('pay_money',10,2);//支付金额
            $table->integer('pay_time');//支付时间
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('order');
    }
}
